<template>
  <div class="dashboard-container">
    <div class="classificat-display">
      <div v-for="(item, index) in list" :key="index">
        <span
          style="
            border-left: 3px solid #296de8;
            font-size: 12px;
            padding-left: 1.5rem;
          "
          >{{ item.title }}</span
        >
        <div class="grid-container">
          <div
            v-for="(e, i) in item.list"
            :key="i"
            class="grid-item"
            style="
              border-width: 1px;
              box-sizing: content-box;
              border-color: #ccd3db;
            "
            @click="handlePage(e.path)"
          >
            <div
              style="
                flex: 1 1 0%;
                line-height: 56px;
                text-align: center;
                background-color: #ecf1f7;
              "
            >
              {{ e.showInfoName }}
            </div>
            <div
              class="grid-number"
              style="
                width: 56px;
                height: 56px;
                line-height: 56px;
                text-align: center;
              "
            >
              {{ e.isEdit }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup name="Addition">
const BASIC_INFO_LIST = {
  party_info: [
    {
      title: "家庭基础信息",
      list: [
        {
          showInfoName: "基本信息",
          isEdit: 1,
          path: "/common/basicInfoForm",
        },
        // {
        //   showInfoName: "家庭地图",
        //   isEdit: 1,
        //   path: "/page/map",
        // },
      ],
    },
  ],
  6: [
    // {
    //   title: "机构基础信息",
    //   list: [
    //     {
    //       showInfoName: "基本信息",
    //       isEdit: 1,
    //       path: "/common/basicInfoForm",
    //     },
    //     {
    //       showInfoName: "机构地图",
    //       path: "/page/map",
    //       isEdit: 1,
    //     },
    //   ],
    // },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "机构隐患信息",
          isEdit: 1,
          path: "/supervision/hidden",
        },
        {
          showInfoName: "机构风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          isEdit: 1,
          path: "/special/gas",
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",

          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          isEdit: 1,
          path: "/law/check",
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  poverty_relief_info: [
    {
      title: "车间基础信息",
      list: [
        {
          showInfoName: "基本信息",
          isEdit: 1,
          path: "/common/basicInfoForm",
        },
        // {
        //   showInfoName: "车间地图",
        //   path: "/page/map",
        //   isEdit: 1,
        // },
      ],
    },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "车间隐患信息",
          isEdit: 1,
          path: "/supervision/hidden",
        },
        {
          showInfoName: "车间风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          isEdit: 1,
          path: "/special/gas",
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",

          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          isEdit: 1,
          path: "/law/check",
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  8: [
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "机构隐患信息",
          path: "/supervision/hidden",
        },
        {
          showInfoName: "机构风险信息",
          path: "/supervision/risk",
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
        },
      ],
    },
  ],
  smart_charge_pile_info: [
    {
      title: "充电桩基础信息",
      list: [
        {
          showInfoName: "基本信息",
          isEdit: 1,
          path: "/common/basicInfoForm",
        },
        // {
        //   showInfoName: "智能充电桩地图",
        //   path: "/page/map",
        //   isEdit: 1,
        // },
      ],
    },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "智能充电桩隐患信息",
          path: "/supervision/hidden",
          isEdit: 1,
        },
        {
          showInfoName: "智能充电桩风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
          isEdit: 1,
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
        },
      ],
    },
  ],
  4: [
    // {
    //   title: "市场基础信息",
    //   list: [
    //     {
    //       showInfoName: "基本信息",
    //       path: "/common/basicInfoForm",
    //       isEdit: 1,
    //     },
    //     {
    //       showInfoName: "市场地图",
    //       path: "/page/map",
    //       isEdit: 1,
    //     },
    //   ],
    // },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "市场隐患信息",
          isEdit: 1,
          path: "/supervision/hidden",
        },
        {
          showInfoName: "市场风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
          isEdit: 1,
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",

          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
          isEdit: 1,
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  2: [
    // {
    //   title: "学校基础信息",
    //   list: [
    //     {
    //       showInfoName: "基本信息",
    //       path: "/common/basicInfoForm",
    //       isEdit: 1,
    //     },
    //     {
    //       showInfoName: "学校地图",
    //       path: "/page/map",
    //       isEdit: 1,
    //     },
    //   ],
    // },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "学校隐患信息",
          path: "/supervision/hidden",
          isEdit: 1,
        },
        {
          showInfoName: "学校风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
          isEdit: 1,
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",

          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
          isEdit: 1,
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  3: [
    // {
    //   title: "医院基础信息",
    //   list: [
    //     {
    //       showInfoName: "基本信息",
    //       path: "/common/basicInfoForm",
    //       isEdit: 1,
    //     },
    //     {
    //       showInfoName: "医院地图",
    //       path: "/page/map",
    //       isEdit: 1,
    //     },
    //   ],
    // },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "医院隐患信息",
          path: "/supervision/hidden",
          isEdit: 1,
        },
        {
          showInfoName: "医院风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
          isEdit: 1,
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",

          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
          isEdit: 1,
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  5: [
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "商超隐患信息",
          path: "/supervision/hidden",
        },
        {
          showInfoName: "商超风险信息",
          path: "/supervision/risk",
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
        },
      ],
    },
  ],
  7: [
    // {
    //   title: "宾馆酒店基础信息",
    //   list: [
    //     {
    //       showInfoName: "基本信息",
    //       isEdit: 1,
    //       path: "/common/basicInfoForm",
    //     },
    //     {
    //       showInfoName: "宾馆酒店地图",
    //       path: "/page/map",
    //       isEdit: 1,
    //     },
    //   ],
    // },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "宾馆酒店隐患信息",
          path: "/supervision/hidden",
          isEdit: 1,
        },
        {
          showInfoName: "宾馆酒店风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
          isEdit: 1,
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",
          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
          isEdit: 1,
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  9: [
    // {
    //   title: "场所基础信息",
    //   list: [
    //     {
    //       showInfoName: "基本信息",
    //       path: "/common/basicInfoForm",
    //       isEdit: 1,
    //     },
    //     {
    //       showInfoName: "场所地图",
    //       path: "/page/map",
    //       isEdit: 1,
    //     },
    //   ],
    // },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "场所隐患信息",
          path: "/supervision/hidden",
          isEdit: 1,
        },
        {
          showInfoName: "场所风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
          isEdit: 1,
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",

          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
          isEdit: 1,
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
  1: [
    {
      title: "企业基本信息",
      list: [
        {
          showInfoName: "危险化学品信息",
          path: "/basic/chemical",
          isEdit: 1,
        },
        {
          showInfoName: "工贸行业设备信息",
          path: "/basic/aequipment",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全生产监管信息",
      list: [
        {
          showInfoName: "许可证信息",
          path: "/supervision/license",
          isEdit: 1,
        },
        {
          showInfoName: "标准化信息",
          path: "/supervision/standardization",
          isEdit: 1,
        },
        {
          showInfoName: "重大危险源",
          path: "/supervision/major",
          isEdit: 1,
        },
        {
          showInfoName: "企业隐患信息",
          path: "/supervision/hidden",
          isEdit: 1,
        },
        {
          showInfoName: "企业风险信息",
          path: "/supervision/risk",
          isEdit: 1,
        },
        {
          showInfoName: "企业应急预案信息",
          path: "/supervision/plan",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全生产管理台账",
      list: [
        {
          showInfoName: "危险作业类型",
          path: "/mag/dangerous",
          isEdit: 1,
        },
        {
          showInfoName: "重点场所",
          path: "/mag/location",
          isEdit: 1,
        },
        {
          showInfoName: "教育培训信息",
          path: "/mag/training",
          isEdit: 1,
        },
        {
          showInfoName: "安全投入",
          path: "/mag/safety",
          isEdit: 1,
        },
        {
          showInfoName: "规章制度",
          path: "/mag/regulations",
          isEdit: 1,
        },
        {
          showInfoName: "日常检查",
          path: "/mag/inspections",
          isEdit: 1,
        },
        {
          showInfoName: "人员持证信息",
          path: "/mag/certifications",
          isEdit: 1,
        },
        {
          showInfoName: "危险作业台账",
          path: "/mag/hazardous",
          isEdit: 1,
        },
      ],
    },
    {
      title: "安全专项信息",
      list: [
        {
          showInfoName: "燃气使用管理信息",
          path: "/special/gas",
        },
        {
          showInfoName: "消防管理信息",
          path: "/special/fire",
          isEdit: 1,
        },
        {
          showInfoName: "用电管理信息",
          path: "/special/electricity",
          isEdit: 1,
        },
        {
          showInfoName: "特种设备使用信息",
          path: "/special/equipment",
          isEdit: 1,
        },
      ],
    },
    {
      title: "行政执法信息",
      list: [
        {
          showInfoName: "执法检查信息",
          path: "/law/check",
          isEdit: 1,
        },
        {
          showInfoName: "处罚信息",
          path: "/law/punish",
          isEdit: 1,
        },
      ],
    },
  ],
};
const router = useRouter();

const list = ref([]);
const id = ref("");
const enterpriseType = ref();
const companyName = ref("");
onMounted(() => {
  // 这里是 created 生命周期的逻辑
  const route = useRoute();
  // 获取 URL 中的参数
  enterpriseType.value = route.query.enterpriseType;
  id.value = route.query.id;
  companyName.value = route.query.companyName;
  for (let key in BASIC_INFO_LIST) {
    if (key === enterpriseType.value) {
      list.value = BASIC_INFO_LIST[key];
    }
  }
});
function handlePage(path) {
  router.push({
    path,
    query: {
      id: id.value,
      enterpriseType: enterpriseType.value,
      companyName: companyName.value,
    },
  });
}
</script>
<style lang="scss" scoped>
.dashboard-container {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 5.32rem - 2.67rem);
  display: flex;
  flex-direction: column;
  .classificat-display {
    flex: 1 1 0%;
    padding: 2rem; /* 32px */
    background-color: rgba(255, 255, 255, 0.6);
    .grid-container {
      margin: 1rem 0;
      font-size: 14px;
      display: grid;
      grid-template-columns: repeat(6, 1fr); /* 一行 6 列 */
      gap: 10px; /* 设置列之间的间距 */
    }

    .grid-item {
      cursor: pointer;
      height: 56px;
      display: flex;
      .grid-number {
        background-color: rgba(204, 211, 219, 0.8);
      }
    }
  }
}
</style>